#define _CRT_SECURE_NO_WARNINGS
#include"SLtlist.h"
void SLTPrint(SN* phead)
{
	SN* pcur = phead;
	while (pcur!=NULL)
	{
		printf("%d-> ", pcur->data);
		pcur = pcur->next;
	}
	printf("NULL\n");
}
SN* SLTbuynode(SLTDataType y)
{
	SN* newnode = (SN*)malloc(sizeof(SN));
	if (newnode==NULL)
	{
		perror("malooc fail;");
		exit(1);
	}
	newnode->data = y;
	newnode->next = NULL;
	return newnode;
	

}
void SLTpushback(SN** pphead, SLTDataType x)
{
	SN* newnode = SLTbuynode(x);
	if (*pphead == NULL)
	{
		*pphead = newnode;
	}
	else
	{
		SN* tail = *pphead;
		while (tail->next != NULL)
		{
			tail = tail->next;
		}
		tail->next = newnode;
	}
}